package cn.donting.jme.edit.ui.inspector.imp.mat;

import cn.donting.jme.edit.attribute.Attribute;
import cn.donting.jme.edit.attribute.StringAttribute;
import cn.donting.jme.edit.ex.AttributeLoader;
import com.jme3.material.Material;

import java.util.ArrayList;
import java.util.List;

/**
 * Material 基本属性
 */
public class MatAttributeLoader implements AttributeLoader<Material> {


    @Override
    public List<Attribute> getAttribute(Material material) {
        StringAttribute stringAttribute = new StringAttribute();
        stringAttribute.setEnabled(false);
        stringAttribute.setTitle("Material");
        stringAttribute.setValue(material.getClass().getName());

        ArrayList<Attribute> attributes = new ArrayList<>();
        attributes.add(stringAttribute);
        return attributes;
    }

    @Override
    public boolean isLoad(Object object) {
        if (object instanceof Material) {
            return true;
        }
        return false;
    }

}
